Move gravity_works back to a static global variable, since it is a global
authorOwen Taylor <otaylor@redhat.com>
Thu, 28 Jan 1999 04:12:58 +0000 (04:12 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 28 Jan 1999 04:12:58 +0000 (04:12 +0000)
Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>

* gtk/gtklayout.[ch] (gtk_layout_realize): Move
gravity_works back to a static global variable,
since it is a global constant, and this way we
keep structure sizes uniform.

CV: ---------------------------------------------------------------------- CVS: Enter Log.  Lines beginning with `CVS: ' are removed automatically

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtklayout.c
gtk/gtklayout.h

index 5467daf28645445fac4c8f1184a9548b1bcb7c06..662bb9f2033813f8adaf76f37cd7075e9387b2f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklayout.[ch] (gtk_layout_realize): Move 
+       gravity_works back to a static global variable,
+       since it is a global constant, and this way we
+       keep structure sizes uniform.
+
 Wed Jan 27 22:59:07 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am (static_SOURCES): Move gtkintl.h
index 5467daf28645445fac4c8f1184a9548b1bcb7c06..662bb9f2033813f8adaf76f37cd7075e9387b2f3 100644 (file)
@@ -1,3 +1,10 @@
+Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklayout.[ch] (gtk_layout_realize): Move 
+       gravity_works back to a static global variable,
+       since it is a global constant, and this way we
+       keep structure sizes uniform.
+
 Wed Jan 27 22:59:07 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am (static_SOURCES): Move gtkintl.h
index 5467daf28645445fac4c8f1184a9548b1bcb7c06..662bb9f2033813f8adaf76f37cd7075e9387b2f3 100644 (file)
@@ -1,3 +1,10 @@
+Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklayout.[ch] (gtk_layout_realize): Move 
+       gravity_works back to a static global variable,
+       since it is a global constant, and this way we
+       keep structure sizes uniform.
+
 Wed Jan 27 22:59:07 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am (static_SOURCES): Move gtkintl.h
index 5467daf28645445fac4c8f1184a9548b1bcb7c06..662bb9f2033813f8adaf76f37cd7075e9387b2f3 100644 (file)
@@ -1,3 +1,10 @@
+Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklayout.[ch] (gtk_layout_realize): Move 
+       gravity_works back to a static global variable,
+       since it is a global constant, and this way we
+       keep structure sizes uniform.
+
 Wed Jan 27 22:59:07 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am (static_SOURCES): Move gtkintl.h
index 5467daf28645445fac4c8f1184a9548b1bcb7c06..662bb9f2033813f8adaf76f37cd7075e9387b2f3 100644 (file)
@@ -1,3 +1,10 @@
+Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklayout.[ch] (gtk_layout_realize): Move 
+       gravity_works back to a static global variable,
+       since it is a global constant, and this way we
+       keep structure sizes uniform.
+
 Wed Jan 27 22:59:07 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am (static_SOURCES): Move gtkintl.h
index 5467daf28645445fac4c8f1184a9548b1bcb7c06..662bb9f2033813f8adaf76f37cd7075e9387b2f3 100644 (file)
@@ -1,3 +1,10 @@
+Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklayout.[ch] (gtk_layout_realize): Move 
+       gravity_works back to a static global variable,
+       since it is a global constant, and this way we
+       keep structure sizes uniform.
+
 Wed Jan 27 22:59:07 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am (static_SOURCES): Move gtkintl.h
index 5467daf28645445fac4c8f1184a9548b1bcb7c06..662bb9f2033813f8adaf76f37cd7075e9387b2f3 100644 (file)
@@ -1,3 +1,10 @@
+Wed Jan 27 23:05:55 1999  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtklayout.[ch] (gtk_layout_realize): Move 
+       gravity_works back to a static global variable,
+       since it is a global constant, and this way we
+       keep structure sizes uniform.
+
 Wed Jan 27 22:59:07 1999  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/Makefile.am (static_SOURCES): Move gtkintl.h
index 85cc99057aacc9d4cfed97f597a8ec25ed5d07f9..353c3f1a8c08e7525e42287714fc16017631a0a7 100644 (file)
@@ -110,6 +110,7 @@ static void     gtk_layout_remove_child_cb (GdkWindow *parent,
 
 
 static GtkWidgetClass *parent_class = NULL;
+static gboolean gravity_works;
 
 /* Public interface
  */
@@ -473,7 +474,11 @@ gtk_layout_realize (GtkWidget *widget)
   gdk_window_add_filter (widget->window, gtk_layout_main_filter, layout);
   gdk_window_add_filter (layout->bin_window, gtk_layout_filter, layout);
 
-  layout->gravity_works = gdk_window_set_static_gravities (layout->bin_window, TRUE);
+  /* XXX: If we ever get multiple displays for GTK+, then gravity_works
+   *      will have to become a widget member. Right now we just
+   *      keep it as a global
+   */
+  gravity_works = gdk_window_set_static_gravities (layout->bin_window, TRUE);
 
   tmp_list = layout->children;
   while (tmp_list)
@@ -939,7 +944,7 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
 
   if (dx > 0)
     {
-      if (layout->gravity_works)
+      if (gravity_works)
        {
          gdk_window_resize (layout->bin_window,
                             widget->allocation.width + dx,
@@ -963,7 +968,7 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
     }
   else if (dx < 0)
     {
-      if (layout->gravity_works)
+      if (gravity_works)
        {
          gdk_window_move_resize (layout->bin_window,
                                  dx, 0,
@@ -988,7 +993,7 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
 
   if (dy > 0)
     {
-      if (layout->gravity_works)
+      if (gravity_works)
        {
          gdk_window_resize (layout->bin_window,
                             widget->allocation.width,
@@ -1012,7 +1017,7 @@ gtk_layout_adjustment_changed (GtkAdjustment *adjustment,
     }
   else if (dy < 0)
     {
-      if (layout->gravity_works)
+      if (gravity_works)
        {
          gdk_window_move_resize (layout->bin_window,
                                  0, dy,
index 862da8b69e4281efdbf727cf8c5fc6544f32007e..d42718e2210c06d1c401bf63dddf7977c07c1ebc 100644 (file)
@@ -63,8 +63,6 @@ struct _GtkLayout {
   gint scroll_y;
 
   guint freeze_count;
-
-  guint gravity_works : 1;
 };
 
 struct _GtkLayoutClass {